package com.supermarket.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.supermarket.entity.User;
import com.supermarket.util.R;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface UserService extends IService<User> {
    User getById(Long id);
    User getByUserCode(String userCode);
    List<User> getAll();
    void create(User user);

    int update(User user);

    void delete(Long id);

    User login(String userCode, String plainPassword);

    void updateUserImage(Long id, String headUrl);
    
    R<Object> getUserList(Integer currentPage, Integer pageSize, String userCode, String userName);
    
    R<String> updatePassword(Long userId, String oldPassword, String newPassword);
}
